<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title><?php echo $page_title?></title>
<link href="<?php echo base_url(); ?>images/icono.ico"
	rel="shortcut icon" type="image/x-icon">
<link rel="stylesheet" type="text/css"
	href="<?php echo base_url(); ?>css/registrate.css">

<!--Estilos para el datatable-->
<style type="text/css" title="currentStyle">
@import "<?php echo base_url(); ?>css/demo_page.css";

@import "<?php echo base_url(); ?>css/demo_table.css";

@import "<?php echo base_url(); ?>css/demo_table_jui.css";

@import
	"<?php echo base_url(); ?>themes/smoothness/jquery-ui-1.8.4.custom.css"
	;
</style>

<!--Llamando a los js son para el datatable-->
<script type="text/javascript"
	src="<?php echo base_url(); ?>js/jquery-1.10.1.min.js"></script>
<script type="text/javascript"
	src="<?php echo base_url(); ?>js/jquery.dataTables.js"></script>
<script type="text/javascript"
	src="<?php echo base_url(); ?>js/hideshow.js"></script>
<script type="text/javascript"
	src="<?php echo base_url(); ?>js/jquery.lightbox-0.5.min.js"></script>
<script type="text/javascript"
	src="<?php echo base_url(); ?>js/jquery.MultiFile.js"></script>
<!--Las Tablas que tengan el id="example" se aplicara datatables"-->
<script type="text/javascript" charset="utf-8">
			$(document).ready(function() {
				$('#example').dataTable({
        		"bJQueryUI": true,
        		"sPaginationType": "full_numbers"
        	});
    	});
		</script>

<script type="text/javascript"
	src="<?php echo base_url(); ?>js/jquery.min.js"></script>
<script type="text/javascript">
			function cambiaDocumento (select) {
				var selectedOption = select.options[select.selectedIndex];
				//alert ("The selected option is " + selectedOption.value);
				$('#doc').load('cargarDocumento?cbxDocumento='+selectedOption.value);
			}
			
			function cambiaProvincia (select) {
    			var selectedOption = select.options[select.selectedIndex];
        		//alert ("The selected option is " + selectedOption.value);
        		$('#pro').load('cargarProvincia?cbxDepartamento='+selectedOption.value);
    		}

			function cambiaDistrito () {
    			/*
    	    	 * 02/06/2015
    	    	 se llamo a provincia y departamento por medio de variables y luego
    	    	 se las paso a la funcion cargarDistrito 	 
    	    	 */
    			var prov = document.Rproveedor.cbxProvincia.value;  
    			var dept = document.Rproveedor.cbxDepartamento.value;     		
        		$('#dis').load('cargarDistrito?prov='+prov+'&dept='+dept);
    		}    

			function justNumbers(e){
				var keynum = window.event ? window.event.keyCode : e.which;
	        	if ((keynum == 8) || (keynum == 46))
					return true;
	         	return /\d/.test(String.fromCharCode(keynum));
	        }    
		</script>

</head>
<body>

	<div class="flex-container">
		<div>
			<img class="barra"
				src="<?php echo base_url();?>images/repuestock.png" />
		</div>
		<div>
			<img class="barra" src="<?php echo base_url();?>images/red.png" />
		</div>
	</div>

	<section id="main">
		<h4
			class="<?
			if (isset ( $class ))
				echo $class;
			else
				echo "alert_info"?>">
        			<?
											
											if (isset ( $mensaje ))
												echo $mensaje;
											else
												echo "Registre los datos de los responsables";
											?>
   			 	</h4>

		<article class="module width_full">
			<header>
				<h3><?= $page_title ?></h3>
			</header>
			<div class="module_content" id="contenido">
						<?
						
						if (isset ( $logo ))
							echo "<center><img src='" . base_url () . "images/bienvenido.png' height='225' width='500'></center>";
						?>
	
	<div class="formulario">
					<form name="Rrespnsable"
						action="<?php echo base_url(); ?>index.php/responsable/insertar"
						method="POST">
						<center><input type="button" onclick="location.href='<?php echo base_url();?>'" value="Regresar"></center><br/>
						<fieldset>
							<legend>Datos del Responsable</legend>
							<table>
								<tr>
									<td><label>Nombres:</label></td>
									<td><input type="text" name="txtNombres" size="50"
										placeholder="Nombres del Cliente"
										title="Letras y espacios en blanco. NO incluir tildes, el caracter ñ y minusculas"
										pattern="[A-Z ]{2,40}" maxlength="40"
										onkeyup="javascript:this.value=this.value.toUpperCase()"
										required></td>
								</tr>
								<tr>
									<td><label>Apellidos:</label></td>
									<td><input type="text" name="txtApellidos" size="50"
										placeholder="Apellidos del Cliente"
										title="Letras y espacios en blanco. NO incluir tildes, el caracter ñ y minusculas"
										pattern="[A-Z ]{2,40}" maxlength="40"
										onkeyup="javascript:this.value=this.value.toUpperCase()"
										required></td>
								</tr>
								<!-- <tr>
											<td><p>Tipo de Documento:</p></td>
											<td>
												<select id="cbxDocumento" name="cbxDocumento" onchange="cambiaDocumento(this)" required>
													<option value=""><?php echo STR_VALOR_INICIAL;?></option>
													<?php foreach ($tipo_documento as $td):?>
													<option value="<?= $td->id_tabla_maestra ?>"><?= $td->nombre?></option>
													<?php endforeach;?>
												</select>
											</td>
								</tr>
								<tr>
											<td><p>N° Documento:</p></td>
											<td>
												<div id="doc" class="content-1" style="left: 27.2%; top: 52%;">
													<input type='text' name='txtNumdoc' size='25' placeholder='Número de documento' title='Solo números' pattern='[0-9]{8,11}' maxlength="11" onkeypress="return justNumbers(event)" disabled/>
												</div> 
                							</td>
								</tr> -->
								<tr>
									<td><p>Fecha de Nacimiento:</p></td>
									<td><input type="date" name="dNacimiento" size="50"
										max="<?php echo date('Y-m-d', strtotime('-18 year'));?>"
										required></td>
								</tr>
								<tr>
									<td><label>Dirección:</label></td>
									<td><input type="text" name="txtDireccion" size="50"
										onkeyup="javascript:this.value=this.value.toUpperCase()"
										maxlength="60" pattern="[A-Z0-9ÁÉÍÓÚÑ&Ü /*|°.]{5,60}" required></td>
								</tr>
								<tr>
									<td><label>Correo:</label></td>
									<td><input type="email" name="txtCorreo" size="50"
										placeholder="Ej: example@example.com" maxlength="60" required="required"></td>
								</tr>
								<tr>
									<td><label>Celular:</label></td>
									<td><input type="tel" name="txtCelular" size="50"
										placeholder="Ej: 987654321" pattern="[0-9]{9}" maxlength="9"
										onkeypress="return justNumbers(event)" required="required"></td>
								</tr>
								<tr>
									<td><label>Teléfono:</label></td>
									<td><input type="tel" name="txtTelefono" size="50"
										placeholder="Ej: 2365478" pattern="[0-9]{7}" maxlength="7"
										onkeypress="return justNumbers(event)" required="required"></td>
								</tr>
								<tr>
									<td colspan="2">
										<center>
											<input type="submit" value="Agregar">
										</center>
									</td>
								</tr>
							</table>
						</fieldset>
					</form>
				</div>

				<hr>

				<section id="dt_example" style="width: 925px;">
					<div id="container">
						<table border="1" class="display" id="example">
							<thead>
								<tr>
									<th>#</th>
									<th>NOMBRES</th>
									<th>APELLIDOS</th>
									<th>CORREO</th>
									<th>EDITAR</th>
									<th>ELIMINAR</th>
								</tr>
							</thead>
							<tbody>
				<?php $n="";foreach ($responsable as $r){ $n += 1;?>
				<tr>
									<td><?php echo $n ?></td>
									<td><?php echo $r->nombres ?></td>
									<td><?php echo $r->apellidos ?></td>
									<td><?php echo $r->correo ?></td>
									<td class="center"><a
										href="<? echo base_url();?>index.php/responsable/accion?id=<?=$r-> id_solicitud_responsable?>"
										style="padding-left: 0px;"> <img
											src="<? echo base_url();?>images/editar.png" width="20"
											height="20" />
									</a></td>

									<td class="center"><a
										onclick="return confirm('¿Esta seguro que desea eliminar responsable?')"
										href="<? echo base_url();?>index.php/responsable/eliminar?id=<?=$r-> id_solicitud_responsable?>"
										style="padding-left: 0px;"> <img
											src="<? echo base_url();?>images/eliminar.png" width="20"
											height="20" />
									</a></td>
								</tr>
				<?php }; ?>
			</tbody>
						</table>
					</div>
					<center>
						<input type="button"
							onclick="location.href='<?php echo base_url() . 'index.php/proveedor/index2/' . 1 . '/' . $idSolUsuario ?>'"
							value="Terminar">
					</center>
					<br />
				</section>

			</div>
		</article>

	</section>

</body>
</html>